<style type="text/css">
table.imagetable {
    font-family: verdana,arial,sans-serif;
    font-size:11px;
    color:#333333;
    border-width: 1px;
    border-color: #999999;
    border-collapse: collapse;
}
<!--
table.imagetable th {
    background:#f5f5f5
    border-width: 0px;
    padding: 5px;
    border-style: solid;
    border-color: #999999;
}
table.imagetable td {
    background:#ffffffff
    border-width: 0px;
    padding: 5px;
    border-style: solid;
    border-color: #999999;
}-->
</style>
<script type="text/javascript">//<![CDATA[

	XHR.poll(10, '<%=url('admin/network/user_status')%>', null,
		function(x, st)
		{
			var tb = document.getElementById('user_status_table');
			var str=JSON.stringify(st);
			if (st && tb)
			{
				/* clear all rows */
				while(tb.rows.length > 1)
					tb.deleteRow(1);
				for(var i = 0; i < st.length; i++ )
				{
					var action_status=""
					if(st[i].latest_action == 1)
						action_status="已过滤"
					else
						action_status="未过滤"
					var hostname=""
					if(st[i].hostname == "" || st[i].hostname == "*"){
						hostname="?";
					}
					else{
						hostname=st[i].hostname;
					}
					var tr = tb.insertRow(-1);
					//tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
					tr.insertCell(-1).innerHTML = hostname;
					tr.insertCell(-1).innerHTML = st[i].mac;
					tr.insertCell(-1).innerHTML = st[i].ip;
					tr.insertCell(-1).innerHTML = st[i].appname;
					tr.insertCell(-1).innerHTML = st[i].drop_num;
					tr.insertCell(-1).innerHTML = st[i].total_num;
					tr.insertCell(-1).innerHTML = st[i].latest_time;
					tr.insertCell(-1).innerHTML = action_status;
				}
			}
		}
	);
//]]></script>


<fieldset class="cbi-section">
	<legend><%:访问记录%></legend>
	<table class="imagetable" id="user_status_table">
		<tr>
			<th ><%:主机名%></th>
			<th ><%:mac地址%></th>
			<th ><%:ip地址%></th>
			<th ><%:App名称%></th>
			<th><%:丢包次数%></th>
			<th ><%:访问次数%></th>
			<th><%:最后访问时间%></th>
			<th><%:过滤状态%></th>
		</tr>
		<tr>
			<td colspan="8"><em><br /><%:Collecting data...%></em></td>
		</tr>
	</table>
</fieldset>
